<?php

namespace backend\modules\base\controllers;

use backend\modules\log\models\Adminlog;
use Yii;
use yii\redis\Cache;
use yii\web\Controller;

/**
 * BaseController implements the CRUD actions for Base model.
 */
class BaseController extends Controller
{
    /**
     * 缓存对象
     *
     * @var $cache \yii\redis\Cache;
     */
    public $cache;

    public function beforeAction($action)
    {
        Adminlog::saveLog($this->module->id,$this->module->controllerNamespace,$this->action->id);

        $this->cache = new Cache();
        return parent::beforeAction($this->action);
    }
}
